package com.luokangtao.user.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

/**
 * 查询用户结果
 * @author luokangtao
 * @create 2019-07-25 16:33
 */
@ApiModel(value="XcUser用户实体类")
@Data
@TableName(value = "xc_user")
@Accessors(chain = true) //开启链写编程
public class UserResult {
    /**
     * 用户主键id
     */
    @TableId(value = "id")
    @ApiModelProperty(value="用户主键id",hidden = true)
    private String id;

    /**
     * 用户登陆名
     */
    @TableField(value = "loginname")
    @ApiModelProperty(value="用户登陆名",example = "lkt13713676163",required = true)
    private String loginname;

    /**
     * 姓名
     */
    @TableField(value = "name")
    @ApiModelProperty(value="姓名",example = "李大龙",required = true)
    private String name;

    /**
     * 头像
     */
    @TableField(value = "userpic")
    @ApiModelProperty(value="头像")
    private String userpic;

    /**
     * 生日
     */
    @TableField(value = "birthday")
    @ApiModelProperty(value="生日")
    private LocalDateTime birthday;

    /**
     * 性别 0:女 1:男
     */
    @TableField(value = "sex")
    @ApiModelProperty(value="性别",example = "1",required = true)
    private String sex;

    /**
     * 邮箱地址
     */
    @TableField(value = "email")
    @ApiModelProperty(value="邮箱地址",example = "423082732@qq.com",required = true)
    private String email;

    /**
     * 联系方式
     */
    @TableField(value = "phone")
    @ApiModelProperty(value="联系方式",example = "13713676163")
    @Pattern(regexp = "^(1[3,4,5,7,8,9][0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}$",message = "手机格式有误:支持13 14 15 17 18 19")
    private String phone;

    /**
     * QQ
     */
    @TableField(value = "qq")
    @ApiModelProperty(value="QQ")
    private String qq;

    /**
     * 用户状态
     */
    @TableField(value = "status")
    @ApiModelProperty(value="用户状态",hidden = true)
    private String status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @ApiModelProperty(value="创建时间",hidden = true)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    @ApiModelProperty(value="修改时间",hidden = true)
    private LocalDateTime updateTime;
}
